package br.com.threads;

public class Programa17 implements Runnable{
	public static void main(String[] args) {
		Programa17 p = new Programa17();
		Thread t1 = new Thread(p);
		Thread t2 = new Thread(p);
		t1.start();
		t2.start();
	}
	public void run(){
		mostraLetra();
	}
	public void mostraLetra(){
		synchronized(this){//bloco synchronized
			for(int i = 65; i <= 90; i++){
				char c = (char)i;
				System.out.print(" " + c);
				if((char)i == 'Z')
					System.out.println();
			}				
		}
	}
}
